package com.servicea.service;

import com.alibaba.fastjson.JSON;
import com.sml.requset.SmlAlertRequest;
import com.sml.service.alert.SMLAlertService;
import com.sml.util.RestTemplateFactory;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * @Author linlx
 * @Date 2021/9/7 15:56
 * @Description
 **/
@Service
public class DingDingAlertServiceImpl implements SMLAlertService {

  @Override
  public void alert(List<String> feignIdList) {
    SmlAlertRequest request = new SmlAlertRequest();
    request.setFeignIdList(feignIdList);
    RestTemplateFactory
        .postForEntity("http://localhost:8004/sml/alert", null, JSON.toJSON(request),
            String.class);
  }
}
